package tgc.edu.tms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import tgc.edu.tms.custom.CommonService;
import tgc.edu.tms.custom.TimeUtils;
import tgc.edu.tms.entity.FlowTable;
import tgc.edu.tms.entity.WorkSheetCount;
import tgc.edu.tms.repository.FlowTableRepository;

@Service
public class FlowTableService  extends CommonService<FlowTable, Integer>{
	@Autowired
	private FlowTableRepository flowTableDAO;
	
	public List<FlowTable> findByTimeAndTeacher(String data, String name) {
		return flowTableDAO.findByTimeAndTeacher(data, name);
	}

	public List<FlowTable> findByTimeAndJcAndTeacher(String week, String jc, String teacher) {
		return flowTableDAO.findByTimeAndJcAndTeacher(week,jc,teacher);
	}

	public List<FlowTable> findByTimeAndJcAndClassRoom(String week, String section, String classroom) {
		return flowTableDAO.findByTimeAndJcAndClassRoom(week,section,classroom);
	}

	public List<FlowTable> findByTimeAndJc(String time, String section) {
		return flowTableDAO.findByTimeAndJc(time,section);
	}

	public FlowTable findByTimeAndJcAndClasses(String repairTime, String jc, String tbClass) {
		return flowTableDAO.findByTimeAndJcAndClasses(repairTime,jc,tbClass);
	}

	/*public FlowTable findByTimeAndJcAndTeacher(String repairTime, String jc, String teacher) {
		
		return flowTableDAO.findByTimeAndJcAndTeacher(repairTime,jc,teacher);
	}
*/
	public List<FlowTable> findByTime(String suspendTime) {
		return flowTableDAO.findByTime(suspendTime);
	}

	public List<FlowTable> findByTimeAndLdAndLc(String time, String ld, String lc) {
		return flowTableDAO.findByTimeAndLdAndLc(time,ld,lc);
	}
	
	public List<FlowTable> findByTeacherAndTimeAndSknr(String name, String time, String sknr) {
		return flowTableDAO.findByTeacherAndTimeAndSknr(name,time,sknr);
	}

	public List<FlowTable> findByTeacherAndTime(String name, String time) {
		return flowTableDAO.findByTeacherAndTime(name,time);
	}

	public List<String> findAllTeacher() {
		return flowTableDAO.findAllTeacher();
	}

	public List<String> findAllCourse(String teacher) {
		return flowTableDAO.findAllCourse(teacher);
	}

	public FlowTable findByJcAndTimeAndClassRoom(String jcsj, String xq, String classroom) {
		return flowTableDAO.findByJcAndTimeAndClassRoom(jcsj,xq,classroom);
	}
	
	public FlowTable findByJcAndTimeAndTeacher(String jcsj, String xq, String name) {
		return flowTableDAO.findByJcAndTimeAndTeacher(jcsj,xq,name);
	}

	public FlowTable findByJcAndTimeAndClasses(String jc, String weekDay, String tbClass) {
		return flowTableDAO.findByJcAndTimeAndClasses(jc,weekDay,tbClass);
	}

	public List<String> findAllYear() {
		return flowTableDAO.findAllYear();
	}

	public List<String> findAllTerm(String year) {
		return flowTableDAO.findAllTerm(year);
	}

	public FlowTable findByJcAndTimeAndTeacherAndYear(String jc, String repairTime, String teacher, String year) {
		return flowTableDAO.findByJcAndTimeAndTeacherAndYear(jc,repairTime,teacher,year);
	}

	public FlowTable findByTimeAndJcAndClassesAndYear(String repairTime, String jc, String tbClass, String year) {
		// TODO Auto-generated method stub
		return flowTableDAO.findByTimeAndJcAndClassesAndYear(repairTime,jc,tbClass,year);
	}

	public FlowTable findByJcAndTimeAndClassesAndYear(String jc, String repairTime, String tbClass, String year) {
		// TODO Auto-generated method stub
		return flowTableDAO.findByJcAndTimeAndClassesAndYear(jc,repairTime,tbClass,year);
	}

	public List<FlowTable> findBybjsj(String string, String string2, String string3, String string4) {
		return flowTableDAO.findBybjsj(string, string2, string3, string4);
	}
	
	public List<String> findTeacher() {
		
		return flowTableDAO.findTeacher();
	}

	public List<Object[]> findCout(String teacher, String time) {
		
		return flowTableDAO.findCout(time,teacher);
	}

	public List<Object[]> findTerm(String term, String teacher) {
		  if(term==null||term=="") {
			  term = TimeUtils.getxq();
		  }
		return flowTableDAO.findTerm(term, teacher);
	}
}
